import React, { Component } from 'react'
import Header from './CateHeader'
import Search from '../components/search'
import CateCategory from './CateBody'
import CateMaterial from './CateBody'
import {CateWrap} from './styledCategory'
import {Switch,Redirect,Route}from 'react-router-dom'
export default class Category extends Component {
  render() {
    return (
      <CateWrap>
        <Header></Header>
        <Search></Search>
        <Switch>
          <Route path="/category" render={ ()=>(<CateCategory defaultItem="口味特色"/>)}/>
          <Route path="/material" render={ ()=>(<CateCategory defaultItem="米面干果腌咸"/>)}/>
          <Redirect from="/" to="/category"/>
        </Switch>
       
        <CateMaterial/>
      </CateWrap>
    )
  }
}
